Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapp.utils.polygonIntersectFeatures #1200

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

dbauszus-glx
Copy link
Member

This PR adds the mapp.utils.polygonIntersectFeatures() method.

A type:polygon draw interaction will check for snap features coordinates to intersect the drawn polygon feature geometry.

Intersecting features are returned to the drawendCallback method.

The drawendCallback can be defined to store the feature id in a set and add the feature to a custom vector layer for visualisation.

function drawendCallback(features) {

  features.forEach(feature => {

    const id = feature.get('id')

    if (layer.selectedLocations.ids.has(id)) return;
    layer.selectedLocations.ids.add(id)
    cloneSource.addFeature(feature)
  })
}

@dbauszus-glx dbauszus-glx added the Feature New feature requests or changes to the behaviour or look of existing application features. label Mar 28, 2024
@GEOLYTIX GEOLYTIX deleted a comment from RobAndrewHurst Mar 28, 2024
Copy link

sonarcloud bot commented Mar 28, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@RobAndrewHurst RobAndrewHurst merged commit 396c2ac into GEOLYTIX:main Apr 2, 2024
5 checks passed
@dbauszus-glx dbauszus-glx deleted the polygonIntersectFeatures branch June 14, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature requests or changes to the behaviour or look of existing application features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants